package com.CMS.server.domain;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@Table(name = EntityTokens.VERSION_TABLE)
public class PageVersion extends BaseEntity{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -990025558545756372L;

	@Column(name = EntityTokens.VERSION_NROVERSION_COLUMN, nullable = false)
	protected long nroVersion;
	
	@Column(name = EntityTokens.VERSION_FLAGACTIVA_COLUMN, nullable = false)
	protected boolean flagActiva;
	
	@OneToOne(cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	protected User user;
	
	@Column(name = EntityTokens.VERSION_CONTENIDO_COLUMN, nullable = false)
	protected String content;

	public long getNroVersion() {
		return nroVersion;
	}

	public void setNroVersion(long nroVersion) {
		this.nroVersion = nroVersion;
	}

	public boolean isFlagActiva() {
		return flagActiva;
	}

	public void setFlagActiva(boolean flagActiva) {
		this.flagActiva = flagActiva;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
}
